<#-- 选择框 -->
<#macro box field setiing options defaultValues>
	<#-- radio -->
	<#if setiing.boxType=="radio">
	<tr>
      <th width="80">${field.name}</th>
      <td>
      	<#list options?keys as item>
      	<label class="ib" style="width:${setiing.width}px">
      		<input type="radio" name="info[${field.field}]" id="${field.field}_${options[item]}" value="${options[item]}" <#list defaultValues as defaultValue><#if defaultValues==$options[item]>checked</#if></#list>>${item}
      	</label>
      	</#list>
      	${field.tips}
      </td>
    </tr>
	</#if>
	<#-- checkbox -->
	<#if setiing.boxType=="checkbox">
	<tr>
      <th width="80">${field.name}</th>
      <td>
      	  <#list options?keys as item>
      	  <label class="ib" style="width:${setiing.width}px">
      	  	<input type="checkbox" name="info[${field.field}]" id="${field.field}_${options[item]}" value="${options[item]}" <#list defaultValues as defaultValue><#if defaultValues==$options[item]>checked</#if></#list>>${item}
      	  </label>
      	  </#list>
      	  ${field.tips}
      </td>
    </tr>
	</#if>
	<#-- select -->
	<#if setiing.boxType=="select">
	<tr>
      <th width="80">${field.name}</th>
      <td>
      	<select name="info[${field.field}]" id="${field.field}">
      		<#list options?keys as item>
      		<option value="${options[item]}" <#list defaultValues as defaultValue><#if defaultValues==$options[item]>selected</#if></#list>>${item}</option>
      		</#list>
      	</select>  
      	${field.tips}
      </td>
    </tr>
	</#if>
	<#-- multiple -->
	<#if setiing.boxType=="multiple">
	<tr>
      <th width="80">${field.name}</th>
      <td>
      	<select name="info[${field.field}]" id="${field.field} " size="2" multiple="multiple" style="height:60px;">
      		<#list options?keys as item>
	      	<option value="${options[item]}" <#list defaultValues as defaultValue><#if defaultValues==$options[item]>selected</#if></#list>>${item}</option>
	      	</#list>
      	</select>  
      	${field.tips}
      </td>
    </tr>
	</#if>
</#macro> 


<#-- 日期框 -->
<#macro datetime field setiing defaultValue>
	<tr>
      <th width="80">${field.name}</th>
      <td><link rel="stylesheet" type="text/css" href="statics/js/calendar/jscal2.css">
			<link rel="stylesheet" type="text/css" href="statics/js/calendar/border-radius.css">
			<link rel="stylesheet" type="text/css" href="statics/js/calendar/win2k.css">
			<script type="text/javascript" src="statics/js/calendar/calendar.js"></script>
			<script type="text/javascript" src="statics/js/calendar/lang/en.js"></script>
			<input type="text" name="info[${field.field}]" id="${field.field}" value="${defaultValue}" size="10" class="date input-text" readonly="">&nbsp;
			<script type="text/javascript">
			Calendar.setup({
			weekNumbers: true,
		    inputField : "${field.field}",
		    trigger    : "${field.field}",
		    dateFormat: "${setiing.format}",
		    showTime: false,
		    minuteStep: 1,
		    onSelect   : function() {this.hide();}
			});
        </script> 
        ${field.tips} 
       </td>
    </tr>
</#macro> 

<#-- 编辑框 -->
<#macro editor field setiing>
<tr>
      <th width="80">${field.name}</th>
      <td>
      	<textarea name="info[${field.field}]" id="${field.field}" boxid="${field.field}" style="visibility: hidden; display: none;"></textarea>
      	 ${field.tips} 
      </td>
    </tr>
</#macro> 

<#-- 图片上传框 -->
<#macro image field setiing>
<tr>
      <th width="80">${field.name}</th>
      <td>
      	<input type="text" name="info[pic]" id="pic" value="" size="" class="input-text">  
      	<input type="button" class="button" onclick="flashupload('pic_images', '附件上传','pic',submit_images,'1,gif|jpg|jpeg|png|bmp,1,,,0','content','0','13a3dab28309cac4445ab2c2aa38fc01')" value="上传图片">
      	<input type="button" style="width: 66px;" class="button" onclick="crop_cut_pic($('#pic').val());return false;" value="裁切图片">
      	<input type="button" style="width: 66px;" class="button" onclick="$('#pic_preview').attr('src','http://bailesi.gotoip4.com/statics/images/icon/upload-pic.png');$('#pic').val(' ');return false;" value="取消图片">
      	<script type="text/javascript">
			function crop_cut_pic(id) {
			    if (id == '') {
			        alert('请先上传缩略图');
			        return false;
			    }
			    window.top.art.dialog({
			        title: '裁切图片',
			        id: 'crop',
			        iframe: 'index.php?m=content&c=content&a=public_crop&module=content&catid=' + catid + '&picurl=' + encodeURIComponent(id) + '&input=pic&preview=',
			        width: '680px',
			        height: '480px'
			    },
			    function() {
			        var d = window.top.art.dialog({
			            id: 'crop'
			        }).data.iframe;
			        d.uploadfile();
			        return false;
			    },
			    function() {
			        window.top.art.dialog({
			            id: 'crop'
			        }).close()
			    });
			};
		</script>  
	</td>
    </tr>
</#macro> 

<#-- 数字输入框 -->
<#macro number field setiing>
	<tr>
      <th width="80">${field.name}</th>
      <td><input type="text" name="info[${field.field}]" id="${field.field}" value="${setiing.defaultValue}" class="input-text" size="">${field.tips}</td>
    </tr>
</#macro> 

<#-- 单行输入框 -->
<#macro text field setiing>
	<tr>
      <th width="80">${field.name}</th>
      <td><input type="<#if setiing.isPassword=="Y">password<#else>text</#if>" name="info[${field.field}]" id="${field.field}" size="${setiing.size}" value="${setiing.defaultValue}" class="input-text">  </td>
    </tr>
</#macro> 

<#-- 多行行输入框 -->
<#macro textarea field setiing>
	<tr>
      <th width="80">${field.name}</th>
      <td><textarea name="info[${field.field}]" id="${field.field}" style="width:${setiing.width}%;height:${setiing.height}px;">${setiing.defaultValue}</textarea>  </td>
    </tr>
</#macro> 

<#-- 栏目 -->
<#macro catalog field catalog>
	<tr>
      <th width="80"> <font color="red">*</font>${field.name}</th>
      <td><input type="hidden" name="info[${field.field}]" value="${catalog.catalogId}">${catalog.catalogName}</td>
    </tr>
</#macro> 


<#-- 标题输入框 -->
<#macro title field setiing>
	<tr>
      <th width="80"> <font color="red">*</font>${field.name}</th>
      <td><input type="text" style="width:400px;" name="info[title]" id="title" value="" class="measure-input  input-text" onblur="$.post('api.php?op=get_keywords&amp;number=3&amp;sid='+Math.random()*5, {data:$('#title').val()}, function(data){if(data &amp;&amp; $('#keywords').val()=='') $('#keywords').val(data); })" onkeyup="strlen_verify(this, 'title_len', 80);"><input type="hidden" name="style_color" id="style_color" value="">
		<input type="hidden" name="style_font_weight" id="style_font_weight" value=""><input type="button" class="button" id="check_title_alt" value="检测重复" onclick="$.get('?m=content&amp;c=content&amp;a=public_check_title&amp;catid=0&amp;sid='+Math.random()*5, {data:$('#title').val()}, function(data){if(data=='1') {$('#check_title_alt').val('标题重复');$('#check_title_alt').css('background-color','#FFCC66');} else if(data=='0') {$('#check_title_alt').val('标题不重复');$('#check_title_alt').css('background-color','#F8FFE1')}})" style="width:73px;"><img src="http://bailesi.gotoip4.com/statics/images/icon/colour.png" width="15" height="16" onclick="colorpicker('title_colorpanel','set_title_color');" style="cursor:hand"> 
		<img src="statics/images/icon/bold.png" width="10" height="10" onclick="input_font_bold()" style="cursor:hand"> <span id="title_colorpanel" style="position:absolute;" class="colorpanel"></span>还可输入<b><span id="title_len">80</span></b> 个字符  </td>
    </tr>
</#macro> 


<#-- 推荐位选择框 -->
<#macro position positions field setiing>
	<tr>
      <th width="80">${field.name}</th>
      <td>
      	  <#list positions as item>
	      <label class="ib" style="width:125px"><input type="checkbox" name="positionIds" id="_${item.positionId}" value="${item.positionId}">${item.description}</label>
	      </#list>
      </td>
    </tr>
</#macro> 

<#-- 关键词输入框 -->
<#macro keyword setiing>
	<tr>
      <th width="80">${field.name}</th>
      <td><input type="text" name="info[keywords]" id="keywords" value="" style="width:280px" class="input-text">  多关键词之间用空格或者“,”隔开</td>
    </tr>
</#macro> 

<#-- 作者选择 -->
<#macro author setiing>

</#macro> 

<#-- 来源选择框 -->
<#macro copyfrom setiing>

</#macro> 

<#-- 是否是连接单选框 -->
<#macro islink setiing>

</#macro> 

<#-- 选择相关内容 -->
<#macro textarea setiing>

</#macro> 



